<?php
class MessageBox{
	
	private static $errorTitle = "Lỗi";
	private static $warningTitle = "Thông báo";
	private static $successTitle = "Thông báo";
	
	/**
	 * 
	 * Enter description here ...
	 * @param unknown_type $message
	 * @param unknown_type $arrayActionCallback: array('far/away')
	 */
	public static function errorMessage($message, $arrayActionCallback){
        $message .= CHtml::Button($message, array('submit' => $arrayActionCallback));
        Dialog::message($errorTitle, $message);
	}
	
	public static function warningMessage($message, $arrayActionCallback){
		 $message .= CHtml::Button($message, array('submit' => $arrayActionCallback));
        Dialog::message($warningTitle, $message);
	}
	
	
	public static function successMessage($message){
		$this->beginWidget('zii.widgets.jui.CJuiDialog'
        , array('options'=>array(
            'title'=>$successTitle
            , 'modal'=>true
            , 'buttons'=>array('OK'=>'js:function(){$(this).dialog("close")}')
            ))
		);
		
		echo $message;
		
		$this->endWidget('zii.widgets.jui.CJuiDialog');
	}
	
}